<?=html::script('js/validator.js')?>
<?=html::script('js/fckeditor/fckeditor.js')?>
<?=html::script('js/jscalendar/calendar.js')?>
<?=html::script('js/jscalendar/lang/calendar-'.$this->lang.'.js')?>
<?=html::script('js/jscalendar/calendar-setup.js')?>
<?=html::link('js/jscalendar/calendar-win2k-2.css', 'stylesheet', 'text/css')?>
<?php $title = 'title_'.$this->lang; ?>
<div id="left-740">
	<div class="box-h1">
		<h1 title="Calendar Add Events"><?=html::image('images/h1/'.$this->lang.'/registration.gif')?></h1>
		<div class="box1 sform">
			<form action="<?=url::site('calender/save')?>" onsubmit="return Validator.Validate(this,1)" method="post" id="register">
				<h3>Add Events</h3>
				<ul><li>
					<span class="label">Short Description:</span>
					<span class="required">*</span>
					<span><input name="title" type="text" dataType="Require" msg="请输入Events标题"/></span>
				</li><li>
					<span class="label">Category:</span>
					<span class="required">*</span>
					<span><select name="category_id" dataType="Require" msg="请选择Events分类">
						<option value="">-</option>
						<?php foreach($categories as $item) { ?>
						<option value="<?=$item->id?>"><?=$item->$title?></option>
						<?php } ?>
					</select></span>
				</li><li>
					<span class="label">Set Time:</span>
					<span class="required"></span>
					<span>Start Time: <select name="start_time_h">
						<option>00</option><option>01</option><option>02</option><option>03</option>
						<option>04</option><option>05</option><option>06</option><option>07</option>
						<option>08</option><option>09</option><option>10</option><option>11</option>
						<option>12</option><option>13</option><option>14</option><option>15</option>
						<option>16</option><option>17</option><option>18</option><option>19</option>
						<option>20</option><option>21</option><option>22</option><option>23</option>
					</select> : <select name="start_time_s">
						<option>00</option><option>05</option><option>10</option><option>15</option>
						<option>20</option><option>25</option><option>30</option><option>35</option>
						<option>40</option><option>45</option><option>50</option><option>55</option>
					</select>&#160;&#160;&#160;&#160;End Time: <select name="end_time_h">
						<option>00</option><option>01</option><option>02</option><option>03</option>
						<option>04</option><option>05</option><option>06</option><option>07</option>
						<option>08</option><option>09</option><option>10</option><option>11</option>
						<option>12</option><option>13</option><option>14</option><option>15</option>
						<option>16</option><option>17</option><option>18</option><option>19</option>
						<option>20</option><option>21</option><option>22</option><option>23</option>
					</select> : <select name="end_time_s">
						<option>00</option><option>05</option><option>10</option><option>15</option>
						<option>20</option><option>25</option><option>30</option><option>35</option>
						<option>40</option><option>45</option><option>50</option><option>55</option>
					</select></span>
				</li><li>
					<span class="label">Occurs:</span>
					<span class="required"></span>
					<span>
						<label><input name="event_type" type="radio" onclick="$('repeating').style.display='none';" value="Once" checked="checked">Once</label>
        				<label><input name="event_type" type="radio" onclick="$('repeating').style.display='block';" value="Repeating">Repeating</label>
					</span>
				</li><li>
					<span class="label"></span>
					<span class="required"></span>
					<span>Start Date: <input type="text" name="start_date" readonly="readonly" value="<?=$year.'-'.($month<10?'0'.$month:$month).'-'.($day<10?'0'.$day:$day)?>" id="f_date_a" style="float:none;width: 100px;"/> Spans: 
						<select name="days">
			                <option>1</option><option>2</option><option>3</option><option>4</option><option>5</option>
							<option>6</option><option>7</option>
					    </select> Day(s)      
					</span>
				</li><li id="repeating" style="display:none;">
					<span class="label"></span>
					<span class="required"></span>
					<span>Repeat every:
				        <input name="repeatM" type="text"  style="float:none;width: 30px;" id="repeatM" value="1" size="4" maxlength="4">
				          <select name="type" id="type">
				              <option value="Years">Years(s)</option>
				              <option value="Months">Month(s)</option>
				              <option value="Weeks">Week(s)</option>
				              <option value="Days">Day(s)</option>
				        </select>
				          Stop After: 
				          <input name="stop" type="text"  style="float:none;width: 30px;" id="stop" value="0" size="4" maxlength="4"> events. (0 = Unlimited)
		  			</span>
				</li><li>
					<span class="label">Details:</span>
					<span class="required"></span>
					<span style="width:500px;">
						<script type="text/javascript">
						<!--
						var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('/')) ;
						
						var oFCKeditor = new FCKeditor( "event_content" ) ;
						oFCKeditor.BasePath	= "<?=url::base()?>js/fckeditor/";
						oFCKeditor.ToolbarSet = "Basic";
						oFCKeditor.UserFilesPath = "upload/events/";
						oFCKeditor.Height	= 400 ;
						oFCKeditor.Value	= '<?=str_replace(array("\r\n", "\n", "\r"), array("","",""), "")?>';
						oFCKeditor.Create() ;
						//-->
						</script>
					</span>
				</li><li>
					<span class="label"></span>
					<span class="required"></span>
					<span><input type="submit" name="submit" value="Submit"/></span>
				</li></ul>
			</form>
		</div>
	</div>
</div>
<script type="text/javascript">
		
    Calendar.setup({
        inputField     :    "f_date_a",  
        ifFormat       :    "%Y-%m-%d"
    });
	    
</script>